import React from 'react'
import { WebView } from 'react-native-webview'
import styled from 'styled-components'

let uri

class AppWebView extends React.Component {
  static navigationOptions = ({ navigation }) => {
    uri = navigation.getParam('uri')
    return {
      title: navigation.getParam('title')
    }
  }

  render() {
    return (
      <Container>
        <WebView
          source={{
            uri
          }}
        />
      </Container>
    )
  }
}

export default AppWebView

const Container = styled.View`
  flex: 1;
`
